package com.tao.design.adapter

/**
 *
 * @ProjectName:    lab
 * @Package:        com.tao.design.adapter
 * @ClassName:      AdapterList
 * @Description:     java类作用描述
 * @Author:         wangxf
 * @CreateDate:     2022/4/26 11:24
 * @UpdateUser:     更新者
 * @UpdateDate:     2022/4/26 11:24
 * @UpdateRemark:   更新说明
 * @Version:        1.0
 */
/**
 * list适配迭代器
 *
 *
 */
interface Iterator {
    fun hasNext(): Boolean;
    fun next(): Any;
    fun remove(): Boolean;
}

interface Enumeration {
    fun hasMoreElements(): Boolean;
    fun nextElement(): Any;
}

class EnumerationIterator(val enumeration: Enumeration) : Iterator {

    override fun hasNext(): Boolean {
        return enumeration.hasMoreElements()
    }

    override fun next(): Any {
        return enumeration.nextElement()
    }

    override fun remove(): Boolean {
        throw UnsupportedClassVersionError();
    }
}

fun main() {

}